{template 'common/header'}
<ol class="breadcrumb we7-breadcrumb">
	<a href="{php echo $this->createWebUrl('linklist', array('module_type'=>'system_welcome'));}"><i class="wi wi-back-circle"></i> </a>
	<li>
		<a href="{php echo $this->createWebUrl('linklist', array('module_type'=>'system_welcome'));}">友情链接管理</a>
	</li>
	<li>
		添加友情链接
	</li>
</ol>
<div class="clearfix">
	<form action="{php echo $this->createWebUrl('linksave', array('module_type'=>'system_welcome'))}" method="post" class="we7-form" role="form" id="form1">
		<input type="hidden" name="link_id" value="{$link['link_id']}"/>
		<div class="form-group">
			<label class="col-sm-2 control-label">友链标题</label>
			<div class="col-sm-8">
				<input type="text" class="form-control" name="link_name" value="{$link['link_name']}" placeholder="友链名称"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">友链地址[http://]</label>
			<div class="col-sm-8">
				<input type="text" class="form-control" name="link_url" value="{$link['link_url']}" placeholder="URL地址"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">缩略图</label>
			<div class="col-sm-8">
				{php echo tpl_form_field_image('link_thumb', $link['link_thumb']);}
			</div>
		</div>
		<div class="form-group">
			<div class="">
				<input type="submit" class="btn btn-primary"  value="提交" />
			</div>
		</div>
	</form>
</div>
<script>
	$(function(){
		$('#form1').submit(function(){
			if(!$.trim($(':text[name="link_name"]').val())) {
				util.message('请填写友情链接标题', '', 'error');
				return false;
			}
			if(!$.trim($(':text[name="link_thumb"]').val())) {
				util.message('请上传缩略图', '', 'error');
				return false;
			}
			return true;
		});
	});
</script>
{template 'common/footer'}
